home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 March / PCWorld_2007-03_cd.bin / domacnost a kancelar / scribus / scribus-1.3.3.7-win32-install.exe / lib / encodings / iso2022_jp_2.py < prev    next >
Text File  |  2004-07-27  |  1KB  |  35 lines

  1. #
  2. # iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2
  3. #
  4. # Written by Hye-Shik Chang <perky@FreeBSD.org>
  5. # $CJKCodecs: iso2022_jp_2.py,v 1.2 2004/06/28 18:16:03 perky Exp $
  6. #
  7.  
  8. import _codecs_iso2022, codecs
  9.  
  10. codec = _codecs_iso2022.getcodec('iso2022_jp_2')
  11.  
  12. class Codec(codecs.Codec):
  13.     encode = codec.encode
  14.     decode = codec.decode
  15.  
  16. class StreamReader(Codec, codecs.StreamReader):
  17.     def __init__(self, stream, errors='strict'):
  18.         codecs.StreamReader.__init__(self, stream, errors)
  19.         __codec = codec.StreamReader(stream, errors)
  20.         self.read = __codec.read
  21.         self.readline = __codec.readline
  22.         self.readlines = __codec.readlines
  23.         self.reset = __codec.reset
  24.  
  25. class StreamWriter(Codec, codecs.StreamWriter):
  26.     def __init__(self, stream, errors='strict'):
  27.         codecs.StreamWriter.__init__(self, stream, errors)
  28.         __codec = codec.StreamWriter(stream, errors)
  29.         self.write = __codec.write
  30.         self.writelines = __codec.writelines
  31.         self.reset = __codec.reset
  32.  
  33. def getregentry():
  34.     return (codec.encode, codec.decode, StreamReader, StreamWriter)
  35.